﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _7_6add : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        UnobtrusiveValidationMode = UnobtrusiveValidationMode.None;
    }

    protected void BtnAdd_Click(object sender, EventArgs e)
    {
        //添加数据
        MyPetShopDataContext db = new MyPetShopDataContext();
        Product p = new Product();
        p.Name = TXTName.Text;
        p.ListPrice = decimal.Parse(TXTPrice.Text);
        p.Descn = TXTDescn.Text;
        p.Qty = Convert.ToInt32(TXTQty.Text);
        db.Product.InsertOnSubmit(p);
        db.SubmitChanges();
        //跳转回原界面
        Response.Redirect("~/7.6.aspx");
    }
}